package com.watson.jvm;

/**
 * @program: mytest
 * @description: jvm
 * @author: zhangpeng348@jd.com
 * @date: 2019-05-18 12:19
 **/
public class JvmOptim {

    public static void main(String[] args){
        byte[] b1,b2,b3,b4;//定义变量
        b1=new byte[1024*1024];//分配 1MB 堆空间，考察堆空间的使用情况
        b2=new byte[1024*1024];
        b3=new byte[1024*1024];
        b4=new byte[1024*1024];
        String a = new StringBuilder("def").toString();
        String str1 = new StringBuilder("abc").toString();
        System.out.println(str1.intern() == str1);

        String str2 = new StringBuilder("def").toString();
        System.out.println(str1.intern() == str2);

    }
}
